package com.skeleton.server.blog.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.skeleton.common.base.dto.ResultDto;
import com.skeleton.common.base.service.impl.BaseServiceImpl;
import com.skeleton.db.dao.IBlogTagDao;
import com.skeleton.db.dto.BlogTagDto;
import com.skeleton.db.entity.BlogTag;
import com.skeleton.server.blog.service.IBlogTagService;

@Service
public class BlogtagServiceImpl extends BaseServiceImpl implements IBlogTagService {

	@Resource
	private IBlogTagDao iBlogTagDao;

	@Override
	public ResultDto getBlogTagHot5() {
		logger.debug("-------BlogtagServiceImpl---getBlogTagHot5-----------------");
		ResultDto rd = new ResultDto();
		
		List<BlogTag> list = iBlogTagDao.selectHot5();
		for (int i = 0; i < list.size(); i++) {
			BlogTag bt = list.get(i);
			rd.addToDtoMap("BlogTagDtoList", bt.toDto());
		}
		
		rd.setSuccess(true);
		return rd;
	}

}
